import time
f1=open("m1_sorted.txt")
a=[]
n=5000
for i in range(5000):
    x=f1.readline()
    a.append(int(x))
s = time.perf_counter()
for i in range(n-1):
    for j in range(n-i-1):
        if a[j]>a[j+1]:
            a[j], a[j+1] =a[j+1], a[j]

es=time.perf_counter()
qwer=(es-s)*1000
qwer=round(qwer,2)
print("m1_sorted.txt",qwer,"milliseconds")
#6556456645645654456
f2=open("m2_reverse.txt")
b=[]
for i in range(5000):
    x22=f2.readline()
    b.append(int(x22))
qwessa = time.perf_counter()
for i in range(n-1):
    for j in range(n-i-1):
        if b[j]>b[j+1]:
            b[j], b[j+1] =b[j+1], b[j]
esqwerqweq=time.perf_counter()
qwerse=(esqwerqweq-qwessa)*1000
qwerse=round(qwerse,2)
print("m2_reverse.txt",qwerse,"milliseconds")
#121345tyg  h
f3=open("m3_shuffle.txt")
m=[]

for i in range(5000):
    x34=f3.readline()
    m.append(int(x34))
sasd = time.perf_counter()
for i in range(n-1):
    for j in range(n-i-1):
        if m[j]>m[j+1]:
            m[j], m[j+1] =m[j+1], m[j]
esasd=time.perf_counter()
qwermon=(esasd-sasd)*1000
qwermon=round(qwermon,2)
print("m3_shuffle.txt",qwermon,"milliseconds")
